package model;

import java.util.ArrayList;
import java.util.List;

import common.DataManager;
import common.GridCoordinate;

/**
 * @author Colin
 * 
 * The LargeCanon is a manual weapon that causes damage to
 * a square area around the position chosen by the user
 *
 */
public class LargeCanon extends ManualWeapon{
	
	private static final int INITIAL_DAMAGE = 6;
	private static final int COST = 200;
	private static final int INITIAL_RANGE_INT = 2;
	private static final int INITIAL_SPEED = 15;
	
	
	//LargeCanon without position
	public LargeCanon(){
		super("Large Canon", DataManager.LARGE_CANON, DataManager.LARGE_CANON_AMMO, COST, INITIAL_DAMAGE, INITIAL_SPEED, INITIAL_RANGE_INT);
		
	}
	
	//LargeCanon with position
	public LargeCanon(GridCoordinate position){
		super("Large Canon", DataManager.LARGE_CANON, DataManager.LARGE_CANON_AMMO, COST, position, INITIAL_DAMAGE, INITIAL_SPEED, INITIAL_RANGE_INT);
		
	}

	@Override
	public void createRange() {
		List<GridCoordinate> r = new ArrayList<GridCoordinate>();
		for( int i = -1*this.getRangeInt(); i <= this.getRangeInt(); ++i ){
			for( int j = -1*this.getRangeInt(); j <= this.getRangeInt(); ++j ){
				r.add( new GridCoordinate( getPosition().getX() + i, getPosition().getY() + j));
			}
		}
		setRange(r);
		
	}

	@Override
	public String getDescription() {
		return "The Large Canon deals 6 damage to all zombosaurs within a large radius of where it lands.";
	}
}
